package validationTestSuite.tests
{
	import com.google.code.flexmetavalidator.metavalidation.MetaValidator;
	
	import org.flexunit.Assert;
	import org.flexunit.asserts.assertFalse;
	import org.flexunit.asserts.assertTrue;
	
	import validationTestSuite.tests.vo.NotNullObject;
	
	public class NotNullTest extends MetaValidatorTest
	{
		public function NotNullTest()
		{
			super();
		}
		
		[Test]
		public function testString():void
		{
			var object : NotNullObject = new NotNullObject();
			object.varString = null;
			
			var testResult : Boolean = validator.validate(object);
			assertFalse(testResult);
			for each (var errStr : String in validator.errors) {trace(errStr)}
		}
		
		[Test]
		public function testNumber():void
		{
			var object : NotNullObject = new NotNullObject();
			object.varNumber = 0;
			
			var testResult : Boolean = validator.validate(object);
			assertTrue(testResult);
			for each (var errStr : String in validator.errors) {trace(errStr)}
		}
		
		[Test]
		public function testObject():void
		{
			var object : NotNullObject = new NotNullObject();
			object.varObject = null
			
			var testResult : Boolean = validator.validate(object);
			assertFalse(testResult);
			for each (var errStr : String in validator.errors) {trace(errStr)}
		}
		
		[Test]
		public function testCollection():void
		{
			var object : NotNullObject = new NotNullObject();
			object.varArrayCollection = null
			
			var testResult : Boolean = validator.validate(object);
			assertFalse(testResult);
			for each (var errStr : String in validator.errors) {trace(errStr)}
		}
		
		[Test]
		public function testGetter():void
		{
			var object : NotNullObject = new NotNullObject();
			object.getObject = null
			
			var testResult : Boolean = validator.validate(object);
			assertFalse(testResult);
			for each (var errStr : String in validator.errors) {trace(errStr)}
		}

		
		[Test]
		public function testAllFine():void
		{
			var object : NotNullObject = new NotNullObject();
			
			var testResult : Boolean = validator.validate(object);
			assertTrue(testResult);
			for each (var errStr : String in validator.errors) {trace(errStr)}
		}
		
		
	}
}